#include "board.h"
#include "rtthread.h"

static void led1_thread_entry(void* parameter);
static void lcd_thread_entry(void* parameter);

static rt_thread_t led1_thread = RT_NULL;
static rt_thread_t lcd_thread = RT_NULL;

int main(void)
{	
    led1_thread = 
			rt_thread_create("led1",led1_thread_entry,RT_NULL,512,3,20);
	  rt_thread_startup(led1_thread);
	
		lcd_thread = 
				rt_thread_create("led1",lcd_thread_entry,RT_NULL,512,2,20);
		rt_thread_startup(lcd_thread);
}

static void led1_thread_entry(void* parameter)
{
	int color = 0;
	while(1)
	{
		LED_Color(color%8);
		color++;
		rt_thread_delay(2000);
		rt_kprintf("Change Color\n");
	}
}
static void lcd_thread_entry(void* parameter)
{
	int num = 0;
	char disp[10];
	while(1)
	{
		sprintf(disp,"Num:%d",num++);
		ILI9341_DispStringLine_EN(LINE(1),disp);
		rt_thread_delay(1000);
	}

}
